<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@include file="/common.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Easy Admin Panel Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript">
	addEventListener("load", function() {
		setTimeout(hideURLbar, 0);
	}, false);

	function hideURLbar() {
		window.scrollTo(0, 1);
	}
</script>
<link href="${ctx}/static/css/style01.css" rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="${ctx}/static/css/icon-font.min.css" type='text/css' />
<script src="${ctx}/static/js/wow.min.js"></script>
<script>
	new WOW().init();
</script>
</head>

<body class="sticky-header">
	<section>
		<div class="left-side sticky-left-side">
			<div class="logo">
				<h1>
					<a href="index.html">
						Easy
						<span>Admin</span>
					</a>
				</h1>
			</div>
			<div class="logo-icon text-center">
				<a href="index.html">
					<i class="lnr lnr-home"></i>
				</a>
			</div>
			<div class="left-side-inner">
				<ul class="nav nav-pills nav-stacked custom-nav" id="menus_list">
					<li class="active">
						<a onclick="doPage('${ctx}/sys/index/main');">
							<i class="lnr lnr-power-switch"></i>
							<span>主页</span>
						</a>
					</li>
				</ul>
			</div>
		</div>
		<div class="main-content">
			<div class="header-section">
				<div class="menu-right">
					<div class="user-panel-top">
						<div class="profile_details_left">
							<ul class="nofitications-dropdown">
								<div class="clearfix"></div>
							</ul>
						</div>
						<div class="profile_details" style="    width: 160px;">
							<ul>
								<li class="dropdown profile_details_drop">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
										<div class="profile_img">
											<span style="background:url('${ctx}/static/img/men.png') no-repeat center"> </span>
											<div class="user-name">
												<p>${sessionScope.sysUser.userName}</p>
											</div>
											<i class="lnr lnr-chevron-down"></i>
											<i class="lnr lnr-chevron-up"></i>
											<div class="clearfix"></div>
										</div>
									</a>
									<ul class="dropdown-menu drp-mnu">
										<li>
											<a onclick="doPage('${ctx}/sys/index/changePwd') ">
												<i class="fa fa-cog"></i>
												修改个人信息
											</a>
										</li>
										<li>
											<a href="${ctx}/sys/login/out">
												<i class="fa fa-sign-out"></i>
												退出
											</a>
										</li>
									</ul>
								</li>
								<div class="clearfix"></div>
							</ul>
						</div>
						<div class="social_icons">
							<div class="clearfix"></div>
						</div>
						<div class="clearfix"></div>
					</div>
				</div>
			</div>
			<div id="page-wrapper">
				<iframe class="RuoYi_iframe" id="mainShow" width="100%" height="100%" src="${ctx}/sys/index/main" frameborder="0" seamless></iframe>
			</div>
		</div>
	</section>

	<script src="${ctx}/static/js/jquery.nicescroll.js"></script>
	<script src="${ctx}/static/js/scripts.js"></script>

	<script>
		$(function() {
			$.get("${ctx}/sys/index/getMenus", {}, function(result) {
				if (result.code == 0) {
					var array = result.data;
					var str = "";
					array.forEach(function(value, index, array) {
						str += '<li class="menu-list"><a href="#"><i class="lnr ' + value.icon + '"></i><span>' + value.menuName;
						str += '</span></a><ul class="sub-menu-list">';
						var subMenu = value.children;
						subMenu.forEach(function(data) {
							str += '<li> <a   onclick="doPage(\'${ctx}/' + data.url + '\')">' + data.menuName + '</a> </li>';
						});
						str += '</ul> </li>';
					})
					$("#menus_list").append(str);
					$('#menus_list').metisMenu(); // ul.nav#side-menu
	
				} else {
					toastr.error('加载菜单失败！');
				}
			});
		})
	
		function doPage(url) {
			$("#mainShow").attr("src", url);
		}
	</script>
</body>
</html>